package com.kaiedu.spring;

import com.kaiedu.spring.component.MonsterDao;
import com.kaiedu.spring.component.MonsterService;
import com.kaiedu.spring.component.SmartAnimalable;
import com.kaiedu.spring.component.SmartDog;
import com.kaiedu.spring.ioc.kaiConfig;
import com.kaiedu.spring.ioc.kaiSpringApplicationContext;


/**
 * @author kai
 * @version 1.0
 * @date 2024/6/11
 * @Description
 */
public class AppMain {

    public static void main(String[] args) {
        kaiSpringApplicationContext context = new kaiSpringApplicationContext(kaiConfig.class);
/*
        MonsterDao monsterDao = (MonsterDao) context.getbean("monsterDao");
        MonsterDao monsterDao1 = (MonsterDao) context.getbean("monsterDao");
        MonsterService monsterService = (MonsterService) context.getbean("monsterService");
        MonsterService monsterService1 = (MonsterService) context.getbean("monsterService");
      *//*  System.out.println("====="+monsterDao);
        System.out.println("====="+monsterDao1);
        System.out.println("====="+monsterService);
        System.out.println("====="+monsterService1);*//*

        //测试依赖注入
        monsterService.m1();*/
        SmartAnimalable smartDog = (SmartAnimalable) context.getbean("smartDog");

        smartDog.getSum(10, 2);
        smartDog.getSub(10, 2);

        System.out.println("ok");
    }


}
